import Vue from 'vue'
import VueRouter from "vue-router";
import Layout from '@/views/layout'
import Collect from '@/views/collect'
import Like from '@/views/like'
import User from '@/views/user'
import Article from '@/views/article'
import Detail from '@/views/article-detail'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path:'/',
      component:Layout,
      children:[
        {
          path:'/collect',
          component:Collect,
        },
        {
          path:'/like',
          component:Like,
        },
        {
          path:'/user',
          component:User,
        },
        {
          path:'/article',
          component:Article,
        },
      ]
    },
    {
      // detail 只是一个名称
      path:'/detail/:id',
      component:Detail,
    },
  ]
})

export default router